'use strict'
//1
var arr1=[1,2,3,4];
function arrr1(arr1,item){
    return arr1.indexOf(item)
}
console.log(arrr1(arr1,2))
//2
var arr2=[ 1, 2, 3, 4 ]
function arrr2(arr2){
    var sum=0;
    arr2.forEach(function(ys){
        sum=sum+ys
    })
    return sum;
}
console.log(arrr2(arr2));
//3
var arr3=[1, 2, 3, 4, 2]
function arrr3(arr3,item){
    var newarrr3=[]
    arr3.forEach(function(ys){
        if(item!==ys){
            newarrr3.push(ys)
        }
    })
    return newarrr3;
}
console.log(arrr3(arr3,2));
//4
var arr4=[1, 2, 2, 3, 4, 2, 2]
function arrr4(arr4,item){
    var newarr4=[]
    arr4.forEach(function(ys){
        if(item!==ys){
            newarr4.push(ys)
        }
    })
    return newarr4;
}
console.log(arrr4(arr4,2));
//5
var arr5=[1, 2, 3, 4]
function arrr5(arr5,item){
    var newarr5=[];
    arr5.unshift(item)
    for(var i=0;i<arr5.length;i++){
        newarr5.push(arr5[i]);
    }
    return newarr5;
};
console.log(arrr5(arr5,10));
//6
var arr6=[1, 2, 3, 4]
function arrr6(arr6){
    var newarr6=[]
    for(var i=1;i<arr5.length-1;i++){
        newarr6.push(arr6[i])
    }
    return newarr6;
}
console.log(arrr6(arr6))
//7
var arr7=[1,2,3,4]
function arrr7(arr7,item){
    var newarr7=[];
    arr7.unshift(item)
    for(var i=0;i<arr5.length;i++){
        newarr7.push(arr5[i]);
    }
    return newarr7;

}
console.log(arrr7(arr7,10));
//8
var arr8=[1,2,3,4]
function arrr8(arr8){
    var newarr8=[]
    arr8.shift();
    arr8.forEach(function(ys){
        newarr8.push(ys)
    })
    return newarr8;
}
console.log(arrr8(arr8))
//9
var arr9=[1,2,3]
var arr99=[4,5]
function arrr9(arr9,arr99){
    var newarr9=arr9.concat(arr99)
    return newarr9;
}
console.log(arrr9(arr9,arr99));
//10
var arr10=[1,2,3,4]
function arrr10(arr10,item,index){
    var newarr10=arr10.slice(index,item);
    return newarr10;
}
console.log(arrr10(arr10,2,3))
//11
var arr11=[1, 2, 4, 4, 3, 4, 3]
function arrr11(arr11,item){
    var sum=0;
    arr11.forEach(function(ys){
        if(item==ys){
            sum++;
        }
    })
    return sum;
}
console.log(arrr11(arr11,4))
//13
var arr13=[1, 2, 3, 4]
function arrr13(arr13){
    var newarr13=[]
    arr13.forEach(function(ys){
        newarr13.push(ys*ys)
    })
    return newarr13;
}
console.log(arrr13(arr13))
//15
var val1=123;
var val2=123;
function val11(val1,val2){
    if(val1==val2){
        return true
    };
}   
console.log(val11(val1,val2))
function area_of_circle(r, pi) {
    if(arguments.length!==1){
        return r*pi*pi;
    }else{
        return r*3.14*3.14       
    }
}
console.log(area_of_circle(5,2));
//17
var t=document.getElementById('test-list');
var tt=t.children;
var newtt=[];
for(var i=0;i<tt.length;i++){
    if(tt[i].innerHTML!='Swift'&&tt[i].innerHTML!='DirectX'){
        newtt.push(tt[i].innerHTML);
    }
}
console.log(newtt);
